const express = require("express");
const router = express.Router();
const userInfoHandler = require('../router_handler/userInfo');
const expressJoi = require('@escook/express-joi');
const { updateUsernameSchema, resetPasswordSchema } = require('../schema/user');

// 获取用户信息
router.get("/getUserInfo", userInfoHandler.getUserInfo);
// 更新用户名
router.post("/changeUsername", expressJoi(updateUsernameSchema), userInfoHandler.updateUsername);
// 重置密码
router.post(
  "/resetPassword",
  expressJoi(resetPasswordSchema),
  userInfoHandler.resetPassword
);


module.exports = router;
